<%-- 
    Document   : display_posts_by_type
    Created on : 2 Jun, 2012, 10:42:56 PM
    Author     : bharat
--%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="./css/maincss.css">
        <link rel="stylesheet" type="text/css" href="./css/myaccountcss.css">
        <title>JSP Page</title>
    </head>
    <body>
        <div class="container">
            <div class="header">
                ONLINE COLLEGE MAGAZINE
            </div>
            <div class="navigation_menu">
                <%@include file="navigationmenu.jsp"%>
            </div>

            <div class="slab">
                <%
                    String pid_ = request.getParameter("pid");

                    Connection con4 = null;
                    PreparedStatement pstmt4 = null;
                    ResultSet rs4 = null;

                    try {

                        Class.forName("oracle.jdbc.driver.OracleDriver");
                        con4 = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "aksh", "aksh");

                        pstmt4 = con4.prepareStatement("select type, subject, post, dop, postedby from posts where pid=?");
                        pstmt4.setString(1, pid_);
                        rs4 = pstmt4.executeQuery();
                %>
                <table>
                    <%
                        while (rs4.next()) {
                    %>                                      
                    <tr>
                        <td>
                            <%=rs4.getString(3)%>
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #DED189">
                            Type: <%=rs4.getString(1)%> Posted on: <%=rs4.getString(4)%> Posted by: <%=rs4.getString(5)%>
                        </td>
                    </tr>
                        <%
                            }
                        %>
                </table>
                <%

                    } catch (Exception e) {
                        response.sendError(505, e.getMessage());
                        e.printStackTrace();
                    }

                %>
            </div>

            <div class="login">
                <%@include file="types_anchored.html" %>
            </div>
            <div class="sidebar">
                <%@include file="archives_sidebar.jsp"%>
            </div>
            <div class="footer">
                FOOTER
            </div>
        </div>
    </body>
</html>
